package com.yw.android.common.base;

import android.app.Application;
import android.content.Context;

import com.yw.android.common.Release;
import com.yw.android.common.utils.AppCrashHandler;
import com.yw.android.common.utils.Executor;
import com.yw.android.common.utils.FLOG;
import com.yw.android.common.utils.PreferenceUtil;


public class BaseApp extends Application {
    private static Application baseApplication;

    public static Context getAppContext() {
        return baseApplication;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        baseApplication = this;
        Executor.execute(new Executor.RunNoThrowable() {
            @Override
            public void rundo() {
                Release.initDebug();
                FLOG.init(BaseApp.this, "PetDog.log");
                PreferenceUtil.getInstance().init(BaseApp.this);
            }
        });
        new AppCrashHandler();
    }
}
